package elijah.base.thread;

import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;

import io.reactivex.disposables.Disposable;

public class ScheduledTask {
    private Object object;

    private Method method;
    private long fixedDelay;

    private long fixedRate;

    private long flexRate;

    private String flexTag;

    private long initialDelay;

    private TimeUnit timeUnit;

    private @Scheduled.Scope
    int scope;

    private Disposable thread;

    public Object getObject() {
        return object;
    }

    public ScheduledTask setObject(Object object) {
        this.object = object;
        return this;
    }

    public Disposable getThread() {
        return thread;
    }

    public ScheduledTask setThread(Disposable thread) {
        this.thread = thread;
        return this;
    }

    public ScheduledTask(Object object, Method method) {
        this.object = object;
        this.method = method;
    }

    public Method getMethod() {
        return method;
    }

    public ScheduledTask setMethod(Method method) {
        this.method = method;
        return this;
    }

    public long getFixedDelay() {
        return fixedDelay;
    }

    public ScheduledTask setFixedDelay(long fixedDelay) {
        this.fixedDelay = fixedDelay;
        return this;
    }

    public long getFixedRate() {
        return fixedRate;
    }

    public ScheduledTask setFixedRate(long fixedRate) {
        this.fixedRate = fixedRate;
        return this;
    }

    public long getFlexRate() {
        return flexRate;
    }

    public ScheduledTask setFlexRate(long flexRate) {
        this.flexRate = flexRate;
        return this;
    }

    public String getFlexTag() {
        return flexTag;
    }

    public ScheduledTask setFlexTag(String flexTag) {
        this.flexTag = flexTag;
        return this;
    }

    public long getInitialDelay() {
        return initialDelay;
    }

    public ScheduledTask setInitialDelay(long initialDelay) {
        this.initialDelay = initialDelay;
        return this;
    }

    public TimeUnit getTimeUnit() {
        return timeUnit;
    }

    public ScheduledTask setTimeUnit(TimeUnit timeUnit) {
        this.timeUnit = timeUnit;
        return this;
    }

    public int getScope() {
        return scope;
    }

    public ScheduledTask setScope(int scope) {
        this.scope = scope;
        return this;
    }
}
